Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter text for view-only users is ReportError. #6292

Merged
merged 6 commits into from
Dec 14, 2022

Conversation

sashadoes
Copy link
Collaborator

@sashadoes sashadoes commented Dec 6, 2022

Summary

Addresses issue:

Relevant technical choices

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 5.6.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions
Copy link

github-actions bot commented Dec 6, 2022

Size Change: +836 B (0%)

Total Size: 1.36 MB

Filename Size Change
./dist/assets/js/googlesitekit-adminbar-********************.js 34.9 kB +139 B (0%)
./dist/assets/js/googlesitekit-api-********************.js 9.32 kB -2 B (0%)
./dist/assets/js/googlesitekit-components-gm2-********************.js 5.82 kB -1 B (0%)
./dist/assets/js/googlesitekit-data-********************.js 2.12 kB -1 B (0%)
./dist/assets/js/googlesitekit-datastore-forms-********************.js 9.13 kB -2 B (0%)
./dist/assets/js/googlesitekit-datastore-site-********************.js 15.3 kB -2 B (0%)
./dist/assets/js/googlesitekit-datastore-user-********************.js 22.9 kB -3 B (0%)
./dist/assets/js/googlesitekit-entity-dashboard-********************.js 63.4 kB +143 B (0%)
./dist/assets/js/googlesitekit-idea-hub-post-list-********************.js 24.8 kB -5 B (0%)
./dist/assets/js/googlesitekit-main-dashboard-********************.js 71.6 kB +122 B (0%)
./dist/assets/js/googlesitekit-modules-********************.js 20.6 kB -2 B (0%)
./dist/assets/js/googlesitekit-modules-adsense-********************.js 69.5 kB -53 B (0%)
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 19.5 kB -4 B (0%)
./dist/assets/js/googlesitekit-modules-analytics-********************.js 71 kB -9 B (0%)
./dist/assets/js/googlesitekit-modules-idea-hub-********************.js 27.1 kB -5 B (0%)
./dist/assets/js/googlesitekit-modules-optimize-********************.js 18.7 kB -2 B (0%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 20 kB -5 B (0%)
./dist/assets/js/googlesitekit-modules-search-console-********************.js 38.3 kB -2 B (0%)
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 31.9 kB -4 B (0%)
./dist/assets/js/googlesitekit-settings-********************.js 49.3 kB -11 B (0%)
./dist/assets/js/googlesitekit-splash-********************.js 68.7 kB -3 B (0%)
./dist/assets/js/googlesitekit-user-input-********************.js 42.4 kB -6 B (0%)
./dist/assets/js/googlesitekit-widgets-********************.js 15.4 kB +421 B (+3%)
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 59.7 kB +133 B (0%)
ℹ️ View Unchanged
Filename Size
./dist/assets/css/googlesitekit-admin-css-********************.min.css 48.5 kB
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 11.1 kB
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 7.24 kB
./dist/assets/js/32-********************.js 2.8 kB
./dist/assets/js/33-********************.js 2.28 kB
./dist/assets/js/34-********************.js 3.72 kB
./dist/assets/js/35-********************.js 51.9 kB
./dist/assets/js/36-********************.js 3.12 kB
./dist/assets/js/analytics-advanced-tracking-********************.js 769 B
./dist/assets/js/googlesitekit-activation-********************.js 27 kB
./dist/assets/js/googlesitekit-base-********************.js 1.13 kB
./dist/assets/js/googlesitekit-components-gm3-********************.js 421 B
./dist/assets/js/googlesitekit-datastore-location-********************.js 2.08 kB
./dist/assets/js/googlesitekit-datastore-ui-********************.js 9.24 kB
./dist/assets/js/googlesitekit-i18n-********************.js 3.92 kB
./dist/assets/js/googlesitekit-idea-hub-notice-********************.js 45 kB
./dist/assets/js/googlesitekit-polyfills-********************.js 379 B
./dist/assets/js/googlesitekit-vendor-********************.js 329 kB
./dist/assets/js/runtime-********************.js 1.28 kB

compressed-size-action

Copy link
Collaborator

@nfmohit nfmohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sashadoes I have requested one small change regarding the CTA display. Thank you for your work on this!

assets/js/components/ReportError.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@nfmohit nfmohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sashadoes It looks like updating the showRequestAccessURL variable was missed out. It also needs to be falsey for a view-only user.

Otherwise, there is a chance it could show the Request access CTA for a view-only user, which this issue is trying to prevent. See screenshot:

image

Back to you for another update. Thanks!

Copy link
Collaborator

@nfmohit nfmohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sashadoes This looks good so far.

I apologise for not noticing this earlier, it looks like adding a test case for this change was mentioned in the IB, but it was missed in the implementation. Could you add a test case covering the change in assets/js/components/ReportError.test.js?

Thanks for your patience!

@sashadoes
Copy link
Collaborator Author

@nfmohit makes sense , thanks :)

Copy link
Collaborator

@nfmohit nfmohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @sashadoes. I've left a few comments on the test case.

{
registry,
},
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The render function only accepts two parameters. The viewContext property needs to be adjacent to the registry property in the second parameter object.

const { queryByText } = render(
<ReportError
moduleSlug={ moduleName }
error={ {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this test does pass, but it doesn't serve our purpose of coverage. This <ReportError /> component doesn't show the Retry button anyway, in any view context. For it to show, the selector should be getReport.

Copy link
Collaborator

@nfmohit nfmohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to avoid the back-and-forth, I've made the changes myself. Thank you, @sashadoes!

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@techanvil techanvil merged commit 8077cb0 into develop Dec 14, 2022
@techanvil techanvil deleted the enhancement/6201-invalid-language-report-error branch December 14, 2022 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants